Skip to content

Conversation

@ysw789
Copy link
Member

@ysw789 ysw789 commented Feb 8, 2025

[feat] 인증 로직 구현

Issue

변경 내용

  • 사용자 인증 구현
  • 관련 API 명세 작성 (swagger)

구현 사항

  • Spring Security 및 관련 인증 Filter 구현
  • 로그인/비밀번호 로그인 구현
  • Member 도메인 구현
  • JWT 인증 구현
  • CORS 비활성 (확인 필요)

참고 사항

  • 로그인, 로그아웃에 대한 API 명세는 별도 작성 필요
  • 매핑되지 않은 엔드포인트에 대한 예외 처리 구현 필요 (404가 응답되어야 하는데 내부 구현에 따라 401이 응답 됨)

ysw789 added 18 commits February 8, 2025 12:16
- ControllerAdvice가 ResponseEntity 타입으로 응답하도록 수정
- 서비스 관련 에러 코드 추가
- ErrorResponse 생성자 수정
- 엔티티 간 공통으로 활용
- Status Enum 추가
- BaseEntity 상속 받은 Member 엔티티 구현
- 회원가입 구현
- Role Enum으로 권한 정의
- SecurityConfig, EncoderConfig 구성
- ErrorResponse 타입으로 예외 응답
- 객체 필드 타입 검증 예외 Handler 추가
- 토큰 생성, 저장, Claims 추출, 만료 등의 작업 수행
- JWT 유효성 검증 필터
- 로그인 요청 시 호출되는 필터
- authenticationManager.authenticate()를 통해 내부적으로 인증 진행
- 인증 성공, 실패 처리 메소드 구현
- 로그아웃 요청 발생 시 catch 하여 토큰 만료 처리 진행
@ysw789 ysw789 requested review from dohy-eon and hodoon February 8, 2025 08:20
@ysw789 ysw789 self-assigned this Feb 8, 2025
Copy link
Member

@dohy-eon dohy-eon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이정돈 프젝 할 때마다 하는 작업이라지만 진짜 작업속도가 빠른 편이긴 하시는군요... 👍

- 인증이 필요하지 않은 접근은 모두 허용해 불필요한 권한 검사를 피함
- 404, 500 등 에러 상황에 따라 ErrorResponse 타입으로 응답하도록 구현
- 에러 코드 추가
@ysw789 ysw789 linked an issue Feb 9, 2025 that may be closed by this pull request
@ysw789
Copy link
Member Author

ysw789 commented Feb 9, 2025

✨ 매핑 되지 않은 엔드포인트 404 예외 처리 수정 완료

@ysw789 ysw789 merged commit b3e9e0c into dev Feb 9, 2025
1 check passed
@ysw789 ysw789 deleted the feat/#1-1 branch February 9, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 인증 로직 구현

3 participants